<!-- <style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style> -->
<template src="./index.html"></template>
<script>
import Edit from "./../edit/index";
export default {
    mixins: [
        Vue.prototype.$vFN.Mixins.Base,
        Vue.prototype.$vFN.Mixins.Page,
        Vue.prototype.$vFN.Mixins.Table,
    ],
    data() {
        return {
            appWindow: window,
            // 页面接口地址
            apiUrl: {
                list: "mall-admin/menu/treeList",
                delete: "mall-admin/menu/delete",
            },
            // 表格查询数据
            mixinTable_tableSearchData: {
                menu_type: "",
            },
            // 表格数据
            tableData: [],
            // 表格数据删除展示结构
            tableDeleteConfig: {
                columns: [
                    {
                        label: "菜单名称",
                        prop: "menuTitle",
                    },
                    {
                        label: "前端标识",
                        prop: "authName",
                        width: 300,
                    },
                    {
                        label: "菜单图标",
                        prop: "menuIcon",
                        type: "icon",
                    },
                    {
                        label: "菜单分类",
                        prop: "menuTypeMap.dictLabel",
                    },

                    {
                        label: "备注信息",
                        prop: "remark",
                    },
                ],
                // title: "确定停用以下内容么?",
            },
            // 表格数据类型
            mixinTable_tableDataType: "tree",

            // 数据字典
            // 菜单类型
            dict_menu_type: [],
        };
    },
    methods: {
        // 初始化
        async init() {
            this.mixinTable_refreshData();
            // 数据字典 运营状态
            this.mixinTable_tableSearchData.dict_menu_type = await this.mixinBase_configDict(
                {
                    type: "menu_type",
                    name: "dict_menu_type",
                },
                this.appWindow
            );
        },

        // 打开添加/修改
        editBoxOpen(params_) {
            let _d = {
                mixinEdit_parent: this,
                mixinEdit_editType: params_.type,
                id: params_.id,
            };
            if (params_.parentId) {
                _d.parentId = params_.parentId;
            }
            Edit.init(_d);
        },
    },
    mounted() {
        this.init();
    },
    activated() {},
};
</script>